Repository navigation
fix(composer): keep the gap after inline chips - #204
Merged
Merged
Conversation
The composer's output transformation added the chip's transparent and letter-spacing styles, then replaced the chip text with its non-breaking form. TextFieldBuffer.replace drops the styles in the replaced range, so the extra spacing that reserves the chip's width was lost and text typed after a chip slid under it. Replace first, then style. Verified on the emulator (session-lab): skill, file and agent chips at the start, middle and end of a draft, chips in a row, wrapping chips, font scale 1.3, and single backspace deleting a chip. New test inlineSkillChipKeepsTheSpaceBeforeFollowingText fails without the fix. scripts/check.sh :feature:composer passes. Fixes #199
Keeps the PR to the one-line reorder in AutocompleteViews.kt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When text follows an inline chip, it slid under the chip. Type
weafter a skill chip and the chip covered thew, though the draft text was right.The output transformation in
AutocompleteViews.ktstyled the chip (transparent text, plus letter spacing that reserves the chip's width) and then replaced the token with its non-breaking form.TextFieldBuffer.replacedrops the styles in the range it replaces, so the reserved width was lost. Now it replaces first and styles after. Thanks to @BurgessTG, whose diagnosis in the issue was right.Skill, file and agent chips at the start of the draft, in a row, and wrapping to a second line:
Verified on the emulator against session-lab: skill, file and agent chips at the start, middle and end of the draft, chips in a row, wrapping chips, font scale 1.3, and one backspace deleting a chip.
Fixes #199